Skip to content

[eas-cli] Use an isolated env for local builds - #4244

Draft
ramonclaudio wants to merge 8 commits into
@ramonclaudio/dvt-119-eas-cli-env-modefrom
@ramonclaudio/dvt-119-local-build-env
Draft

[eas-cli] Use an isolated env for local builds#4244
ramonclaudio wants to merge 8 commits into
@ramonclaudio/dvt-119-eas-cli-env-modefrom
@ramonclaudio/dvt-119-local-build-env

Conversation

@ramonclaudio

@ramonclaudio ramonclaudio commented Aug 21, 2026

Copy link
Copy Markdown
Member

Stacked on #4229.

Why

eas build --local passes every var from the shell to the local-build plugin, which can make local builds behave differently from EAS Build.

How

I updated the local-build plugin process to start with an isolated env, then added the EAS env, local runtime vars, and the local build settings it needs.

Test Plan

Tests, package checks, and local Android and iOS builds pass.

@linear-code

linear-code Bot commented Aug 21, 2026

Copy link
Copy Markdown

DVT-119

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.91%. Comparing base (b0bb4d2) to head (c25f8b3).

Files with missing lines Patch % Lines
packages/eas-cli/src/build/local.ts 88.89% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@                            Coverage Diff                             @@
##           @ramonclaudio/dvt-119-eas-cli-env-mode    #4244      +/-   ##
==========================================================================
+ Coverage                                   63.90%   63.91%   +0.01%     
==========================================================================
  Files                                        1033     1033              
  Lines                                       47555    47566      +11     
  Branches                                    10002    10004       +2     
==========================================================================
+ Hits                                        30384    30395      +11     
+ Misses                                      17070    17069       -1     
- Partials                                      101      102       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ramonclaudio
ramonclaudio marked this pull request as ready for review August 21, 2026 17:37
@github-actions

Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
packages/eas-cli/** @douglowder
packages/eas-cli/src/build/** @sjchmiela

Generated by CodeMention

Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead.

};
process.on('SIGINT', interruptHandler);
try {
const processEnv = getEnvWithoutInheritedDotenvValues(process.env);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXPO_UNSAFE_DOTENV_KEYS and this utility is something I'm not familiar with 🤔 maybe @sjchmiela or @szdziedzic can evaluate this better. I believe, this may be similar to a utility for original-env we have in @expo/env, so not sure if we need to reconsolidate?

@kitten kitten Aug 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revisiting this; assuming we're keeping parity here with EAS Build, is there any way we could just not inherit any env vars and issue a major bump? It might be easier to build up parity than it is to try to pass through filtered process.env vars, and treat the spawned sub-process as "isolated"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, that makes sense! I tested local ios and android builds with the runtime var list I added, but can we confirm these are all the vars we want to keep in the isolated env?

https://github.com/expo/eas-cli/pull/4244/changes#diff-a54f38cd6a574317f91ba14ef751c1868db0d9469f924f18b018222c1c956a6aR18-R33

@ramonclaudio
ramonclaudio force-pushed the @ramonclaudio/dvt-119-eas-cli-env-mode branch from 743749d to b0bb4d2 Compare August 24, 2026 04:02
@ramonclaudio
ramonclaudio force-pushed the @ramonclaudio/dvt-119-local-build-env branch from 30b16eb to 41cf11b Compare August 24, 2026 04:02
@ramonclaudio ramonclaudio changed the title [eas-cli] Remove inherited dotenv values from local builds [eas-cli] Use an isolated env for local builds Aug 24, 2026
@github-actions

Copy link
Copy Markdown

✅ Thank you for adding the changelog entry!

@ramonclaudio
ramonclaudio marked this pull request as draft August 25, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants